const request = require('request');//第三方库
const cherrio = require('cheerio')//第三方库
const mkdirp = require('mkdirp');//第三方库
const express = require('express')//第三方库
const iconV = require('iconv-lite');//第三方库
const fs = require('fs');//node自带
const path = require('path');//node自带
const app = express();

/*创建txt文件夹*/
var dir = path.join(__dirname+'/txt')
mkdirp(dir,function (err) {
    if(err){
        console.log('创建文件夹失败');
    }
})



var option = {
    method:'get',
    encoding:null,
    url:'http://desk.zol.com.cn/meinv/1920x1080/1.html'
}

/*在txt文件夹下创建test.txt文件,并且把hello world写入test.txt文件里*/
fs.writeFile(dir+"/test.txt", "hello world!", function(err) {
    if(err) {
        return console.log(err);
    }
    console.log("The file was saved!");
});
